package org.nepu.scr.indexrate.converter.upgraderate.operationreliability;

import cn.hutool.json.JSONUtil;
import org.nepu.scr.indexrate.vo.upgraderate.operationreliability.AppendixC6;

import javax.persistence.AttributeConverter;
import javax.persistence.Convert;

@Convert
public class AppendixC6Converter implements AttributeConverter<AppendixC6, String> {
    @Override
    public String convertToDatabaseColumn(AppendixC6 appendixC6) {
        return JSONUtil.toJsonStr(appendixC6);
    }

    @Override
    public AppendixC6 convertToEntityAttribute(String s) {
        return JSONUtil.toBean(s, AppendixC6.class);
    }
}
